//
//  OAMainTests.m
//  OANetworkManager
//
//  Created by TFAppleWork-Summer on 2018/2/7.
//  Copyright © 2018年 GuoRui. All rights reserved.
//

#import "Tests.h"
#import "AppNetworkingManager+Main.h"

static NSString * const testPhone = @"18317160680";

@interface OAMainTests : Tests

@end

@implementation OAMainTests

- (void)setUp {
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testExample {
    // This is an example of a functional test case.
    // Use XCTAssert and related functions to verify your tests produce the correct results.
}
#pragma mark - 首页

// 鉴权 ;打卡
-(void)testAuthToken{
    [self expectation:^(void (^fulfill)(void)) {
        NSString *loginName = [[[NSUserDefaults standardUserDefaults] objectForKey:OANETWORKMANAGERUSER_KEY] objectForKey:@"loginName"];
        [AppNetworkingManager authTokenWithLoginName:loginName
                                          completion:^(id object, NSError *error) {
                                              NSLog(@" 鉴权：%@",object);
                                              // 打卡
                                              [AppNetworkingManager signWithToken:object
                                                                         complete:^(id object, NSError *error) {
                                                                             NSLog(@"打卡 ：%@",object);
                                                                             fulfill();
                                                                         }];
//
                                          }];
    }];
   
    
}


// 查询打卡状态
-(void)testGetSign{
    [self expectation:^(void (^fulfill)(void)) {
        [AppNetworkingManager getSignStateComplete:^(id object, NSError *error) {
            NSLog(@"查询打卡：%@",object);
            fulfill();
        }];
    }];
}
- (void)testPerformanceExample {
    // This is an example of a performance test case.
    [self measureBlock:^{
        // Put the code you want to measure the time of here.
    }];
}

@end
